<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    (function () {
        var n="lili";
        function Person(name) {
            var _this={}//创建一个空的对象
            _this._name=name;
            _this.sayHello=function () {
                alert("Phello"+_this._name+n);
            }
            return _this;
        }
        window.Person=Person;
    }());

    function Teacher(name) {
        var _this=Person(name);
        var surperSay=_this.sayHello;
        _this.sayHello=function () {
            surperSay.call(_this);
        alert("Thello"+_this._name);
        }
        return _this;
    }
    var t=Teacher("girl");
    t.sayHello();
</script>
</body>
</html>